Skip to content

feat(db): expose connection startup timeline - #7286

Draft
ravarora2 wants to merge 1 commit into
mainfrom
rarora/db-connection-timeline
Draft

feat(db): expose connection startup timeline#7286
ravarora2 wants to merge 1 commit into
mainfrom
rarora/db-connection-timeline

Conversation

@ravarora2

@ravarora2 ravarora2 commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Why

Pool outcomes and coarse pool-state metrics show pressure after the fact, but they do not show when a checkout began or which writer-connection safety premise failed. Operators need bounded evidence that distinguishes pool saturation from slow or failing connection construction during boot and later pool growth.

What

  • Count the start of each instrumented database checkout and route the huddle-history lookup through the existing typed operation wrapper.
  • Instrument writer-pool construction and every new writer connection across physical-connect success, created-at floor setup, session timeouts, isolation verification, and ready.
  • Emit exact, secret-safe lifecycle receipts on the process boot sequence alongside closed-cardinality counters and duration histograms with frozen label vocabularies and series budgets.
  • Cover the production SQLx hook, initial minimum connections, post-start pool growth, cancellation, setup/isolation failures, Prometheus export, and relay boot lifecycle.
  • Document how to interpret the acquisition and writer-connection signals.

Risk Assessment

Medium — this changes the production writer-pool after_connect hook and adds one counter increment to instrumented checkout paths. The database safety operations and failure semantics are unchanged; telemetry uses fixed enums, excludes URLs/raw errors, and has an explicit per-pod series ceiling. The principal residual risk is observability overhead when SQLx creates replacement connections, bounded to synchronous fixed-schema records and fixed-cardinality metrics.

References

Generated with Codex

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

🔐 Codex Security Review

Status: review required for the current range.

The current range is 88687876f7808a2fd742b7eb2e4b9f87d999ad8d...2c3e30d15b2e5f93cde0159a2fdd15aca571e619.
A new review must complete for this exact range. When manual authorization
is required, a Block organization member must comment exactly
@buzz-security-review 2c3e30d15b2e5f93cde0159a2fdd15aca571e619 to authorize a new review.
Any previous review applies only to its recorded range.

Record operation checkout starts and bounded writer connection setup steps in metrics and lifecycle logs.

Co-authored-by: Ravneet Arora <rarora@squareup.com>
Signed-off-by: Ravneet Arora <rarora@squareup.com>
@ravarora2
ravarora2 force-pushed the rarora/db-connection-timeline branch from f58e948 to 2c3e30d Compare September 3, 2026 19:27
@ravarora2 ravarora2 changed the title Expose database connection startup timeline feat(db): expose connection startup timeline Sep 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant